package com.jz.netthings.application.base.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.jz.netthings.appengine.baseData.JzMachine;
import com.jz.netthings.appengine.service.JzMachineService;
import com.jz.netthings.exception.AdscmSystemException;
import com.jz.netthings.support.SimpleCoreResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zyl
 * @since 2019-03-04
 */
@RestController
@RequestMapping("/adscm/application/jzMachine")
public class JzMachineController {

    @Autowired
    JzMachineService jzMachineService;
    @RequestMapping("/selectUseingMachine")
    public SimpleCoreResponse select( HttpServletRequest request) throws AdscmSystemException{
        Wrapper<JzMachine> jzMachineWrapper =new EntityWrapper<>();
        jzMachineWrapper.eq("state",1);
        List<JzMachine> jzMachines = jzMachineService.selectList(jzMachineWrapper);
        return new SimpleCoreResponse("200","查询成功" ,jzMachines);
    }
}

